<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    div {
      height: 200px;
      width: 200px;
      background-color: #ff4af4;
    }
  </style>
  <script>
    window.addEventListener('load', function () {
      var div = document.querySelector('div');
      window.addEventListener('resize', function () {
        console.log('resize');
        if (window.innerWidth <= 800) {
          div.style.display = 'none'
        } else {
          div.style.display = 'block'
        }
      })
    })
  </script>
</head>
<body>
<div></div>
</body>
</html>